<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <%= javascript_include_tag  "jquery-1.4.3.min" , "rails", "application", "tabs" %>
  <meta name="csrf-token" content="<%= form_authenticity_token %>" />
  <meta name="csrf-param" content="authenticity_token" />
  <title><%= h(yield(:title) || APPLICATION_NAME) %></title>
  <%= stylesheet_link_tag 'application' %>
  <%= yield(:head) %>
  <script type="text/javascript">

      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UA-12230707-4']);
      _gaq.push(['_trackPageview']);

      (function() {
          var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
          ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
          var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
      })();

  </script>
</head>
<body>
<div class="page-div">
  <div id="top_menu">
    <% if logged_in? -%>
        <a href="/site/home">Home</a>
        <% if authorized? -%>
            <a href="/site/admin">Admin</a>
        <% end %>
    <% else %>
        <%= link_to "Home", :controller => "site", :action => :site %>
    <% end -%>
    <%= render :partial => "content/content_types_list" %>

    <span style="float: right">
          <% if logged_in? -%>
          Hello, <%=session[:username]%>
          <a href="/site/logout">Logout</a>
          <% else %>
	    <a href="/site/signup">Register</a> | <a href="/site/login">Login</a>
          <% end -%>
    </span>

  </div>
  <div id="container">
    <div id="flash" class="flash_html">
      <% unless flash[:notice].blank? %>
          <%= flash[:notice]%>
      <% end %>
      <% unless flash[:error].blank? %>
          <%= flash[:error]%>
      <% end %></div>

    <%- if show_title? -%>
        <h1><%=h yield(:title) %></h1>
    <%- end -%>

    <%= yield %>
  </div>
  <div id="footer">
    <table width="100%">
      <tr><td align="center">
        <%= link_to "Web08", "https://web8.cs.ait.ac.th/" %>, 2010. |  <%=link_to "Report a bug", "http://tourism-comm.lighthouseapp.com/"%>  |  <%=link_to "View Source", :controller=> :content, :action=>:view_source%>
      </td></tr>
    </table>
  </div>
</div>
</body>
</html>
